﻿using HighThroughput.Common;
using Ozone.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Ozone.Views.ServiceCenter
{
    /// <summary>
    /// UCAttention.xaml 的交互逻辑
    /// </summary>
    public partial class UCAttention : UserControl
    {
        List<Button> lstButtons = new List<Button>();
        List<Grid> lstGrid = new List<Grid>();
        SolidColorBrush Brush_PurpleBackColor;
        SolidColorBrush Brush_MainBackColor;
        public UCAttention()
        {
            InitializeComponent();

            //找到资源 背景色
            var myResourceDictionaryShared = new ResourceDictionary
            {
                Source = new Uri("Resources/Styles/Shared.xaml", UriKind.RelativeOrAbsolute) // 指定样式文件的路径
            };
            Brush_PurpleBackColor = myResourceDictionaryShared["Brush_PurpleBackColor"] as SolidColorBrush; // 通过key找到指定的样式
            Brush_MainBackColor = myResourceDictionaryShared["Brush_DarkBackColor3"] as SolidColorBrush; // 通过key找到指定的样式



            lblVer.Content = globalVar.g_Ver;

            lstButtons.Add(btn1);
            lstButtons.Add(btn2);
            lstButtons.Add(btn3);
            lstButtons.Add(btn4);

            lstGrid.Add(grd1);
            lstGrid.Add(grd2);
            lstGrid.Add(grd3);
            lstGrid.Add(grd4);


        }

        private void btnSetup_Click(object sender, RoutedEventArgs e)
        {
            string tag = ((Button)sender).Tag.ToString();
            for (int i = 0; i < 4; i++)
            {
                if (i.ToString() == tag)
                {
                    lstButtons[i].Background = Brush_PurpleBackColor;
                    lstGrid[i].Visibility = Visibility.Visible;
                }
                else
                {
                    lstButtons[i].Background = Brush_MainBackColor;
                    lstGrid[i].Visibility = Visibility.Collapsed;
                }
            }
        }
    }
}
